import { defHttp } from "@/utils/http";
import { baseUrlApi } from "./utils";

export type DetailResult = {
  code: number;
  data: any;
  msg: string;
};

export type MaterialStock = {
  warehouseCode: string;
  materialCode: string;
  materialSpecsId: number;
};

/** 库存查询列表分页 */
export const getWarehouseInventoryPageList = (data?: object) => {
  return defHttp.post<DetailResult>({
    url: baseUrlApi("/warehouseInventory/pagelist"),
    data
  });
};

/** 查询库存-单个物料 */
export const queryMaterialStock = (data: MaterialStock) => {
  return defHttp.post<DetailResult>({
    url: baseUrlApi("/warehouseInventory/queryMaterialStock"),
    data
  });
};

/** 查询多物料库存 */
export const getQueryMultiMaterialStock = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/warehouseInventory/queryMultiMaterialStock"),
    data
  });
};
